/**
 * 邮件参数
 * @author dyh 2010-12-19
 */
package com.zjht.gmcc.bean.model;

import com.zjht.gmcc.bean.util.MyConstant;
import com.zjht.gmcc.bean.util.MyFormat;
import com.zjht.gmcc.bean.util.MyParamUtil;

public class MailList implements java.io.Serializable {
	private static final long serialVersionUID = 1715745183706148053L;

	private int mailID;
	private String mailSubject;
	private String mailToADD;
	private String mailCopyTO;

	public MailList(int mailID, String mailSubject, String mailToADD, String mailCopyTO) {
		setMailID(mailID);
		setMailSubject(mailSubject);
		setMailToADD(mailToADD);
		setMailCopyTO(mailCopyTO);
	}

	public int getMailID() {
		return mailID;
	}

	public void setMailID(int mailID) {
		this.mailID = mailID;
	}

	/**
	 * 获取原始标题，例如：TD手机销量日报
	 * @author dyh 2010-12-20
	 * @return
	 */
	public String getMailSubject() {
		return mailSubject;
	}

	/**
	 * 获取标题+地市+无年份的中文日期+ZSMS，例如：TD手机销量日报(广州X月X日)[广东CTMS]
	 * @author dyh 2010-12-20
	 * @param date 日期
	 * @param areaid 地市ID(如果areaid>0，则需要添加地市名称，否则无须添加)
	 * @return
	 */
	public String getMailSubjectByCTMS(String date, int areaid) {
		String areaname = "";
		if (areaid > MyConstant.AREAID_GMCC)
			areaname = MyParamUtil.getAreaName(areaid);
		if (!MyFormat.isStrNull(date) && date.length() == 10)
			date = MyFormat.getDateInCNNoYear(date);
		else
			date = "";
		return mailSubject + (MyFormat.isStrNull(areaname) && MyFormat.isStrNull(date) ? "" : "(") + areaname + date
				+ (MyFormat.isStrNull(areaname) && MyFormat.isStrNull(date) ? "" : ")") + "[" + MyConstant.CTMS + "]";
	}

	/**
	 * 获取标题+无年份的中文日期+ZSMS，例如：TD手机销量日报(X月X日)[广东CTMS]
	 * @author dyh 2010-12-20
	 * @return
	 */
	public String getMailSubjectByCTMS(String date) {
		return getMailSubjectByCTMS(date, MyConstant.AREAID_GMCC);
	}

	/**
	 * 获取标题+ZSMS，例如：TD手机销量日报[广东CTMS]
	 * @author dyh 2010-12-20
	 * @return
	 */
	public String getMailSubjectByCTMS() {
		return getMailSubjectByCTMS(null);
	}

	/**
	 * 获取标题+昨日+ZSMS，例如：TD手机销量日报(X月X日)[广东CTMS]
	 * @author dyh 2010-12-20
	 * @return
	 */
	public String getMailSubjectByCTMSOnYesterday() {
		return getMailSubjectByCTMS(MyFormat.getYesterday());
	}

	/**
	 * 地市邮件获取标题+昨日+ZSMS，例如：TD手机销量日报(东莞X月X日)[广东CTMS]
	 * @author dyh 2010-12-20
	 * @return
	 */
	public String getMailSubjectByCTMSOnYesterday(int areaid) {
		return getMailSubjectByCTMS(MyFormat.getYesterday(), areaid);
	}

	public void setMailSubject(String mailSubject) {
		this.mailSubject = mailSubject;
	}

	public String getMailToADD() {
		return mailToADD;
	}

	public void setMailToADD(String mailToADD) {
		this.mailToADD = mailToADD;
	}

	public String getMailCopyTO() {
		return mailCopyTO;
	}

	public void setMailCopyTO(String mailCopyTO) {
		this.mailCopyTO = mailCopyTO;
	}

}
